﻿using Abp.Domain.Entities.Auditing;
using SingleUserMall.Authorization.Users;
using System.ComponentModel.DataAnnotations.Schema;

namespace SingleUserMall.Items
{
    /// <summary>
    /// 砍价商品记录
    /// </summary>
    public class ItemBargain : FullAuditedEntity<long>
    {
        /// <summary>
        /// 商品id
        /// </summary>
        public long ItemId { get; set; }
        [ForeignKey("ItemId")]
        public virtual Item Item { get; set; }
        /// <summary>
        /// 商品规格Id
        /// </summary>
        public long SpecId { get; set; }
        [ForeignKey("SpecId")]
        public virtual ItemSpec ItemSpec { get; set; }
        /// <summary>
        /// 已达到的砍价价格
        /// </summary>
        public decimal ActualBargainPrice { get; set; }
        /// <summary>
        /// 已砍价格
        /// </summary>
        public decimal ReducedPrice { get; set; }

        /// <summary>
        /// 已砍价次数
        /// </summary>
        public int ActualBargainTimes { get; set; }
        /// <summary>
        /// 参与砍价人列表
        /// </summary>
        public string UserList { get; set; }
        /// <summary>
        /// 发起砍价人Id
        /// </summary>
        public long UserId { get; set; }
        [ForeignKey("UserId")]
        public virtual User User { get; set; }
        /// <summary>
        /// 砍价结束
        /// </summary>
        public bool IsOver { get; set; }
        /// <summary>
        /// 已经砍到底价
        /// </summary>
        public bool IsDown { get; set; }
    }
}
